import request from '@/utils/request'

// 创建工种
export function createSpecialWork(data) {
  return request({
    url: '/biz/special-work/create',
    method: 'post',
    data: data
  })
}

// 更新工种
export function updateSpecialWork(data) {
  return request({
    url: '/biz/special-work/update',
    method: 'put',
    data: data
  })
}

// 删除工种
export function deleteSpecialWork(id) {
  return request({
    url: '/biz/special-work/delete?id=' + id,
    method: 'delete'
  })
}

// 获得工种
export function getSpecialWork(id) {
  return request({
    url: '/biz/special-work/get?id=' + id,
    method: 'get'
  })
}

// 根据类型获得工种
export function getSpecialWorkByType(typeId) {
  return request({
    url: '/biz/special-work/listByType?typeId=' + typeId,
    method: 'get'
  })
}

// 获得工种分页
export function getSpecialWorkPage(query) {
  return request({
    url: '/biz/special-work/page',
    method: 'get',
    params: query
  })
}

// 导出工种 Excel
export function exportSpecialWorkExcel(query) {
  return request({
    url: '/biz/special-work/export-excel',
    method: 'get',
    params: query,
    responseType: 'blob'
  })
}
